#include<bits/stdc++.h>
using namespace std;
int S,T;
int f[77][77][77][77];
int F(int a,int b,int c,int d)
{
	if(f[a][b][c][d])
		return f[a][b][c][d];
	if(a - d * S >= b)
		return f[a][b][c][d] = 1;
	else if(a > d * S && F(b - (a - d * S),a,d,c))
		return f[a][b][c][d] = 1;
	if(d && F(b,a,d - 1,c) == -1)
		return f[a][b][c][d] = 1;
	return f[a][b][c][d] = -1;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("game.in","r",stdin);
	freopen("game.out","w",stdout);
	cin >> S >> T;
	while(T--)
	{
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		cout << (F(a,c,b,d) == 1 ? "YES\n" : "NO\n");
	}
	return 0;
}
